package com.niit.bigdata.service;

import com.niit.bigdata.entity.Spark;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import com.niit.bigdata.config.JdbcTemplateConfig;
import java.util.List;

@Service
public class SparkSqlService {

    public List<Spark> GetCategoryList() {
        String sql = "select * from ll";
        JdbcTemplate jdbcTemplate = new JdbcTemplateConfig().jdbcTemplate();
        List<Spark> list = jdbcTemplate.query(sql, (resultSet, i) -> {
            Spark spark = new Spark();
            spark.set_1(resultSet.getString("_1"));
            spark.set_2(resultSet.getString("_2"));
            return spark;
        });
        return list;
    }


}
